package com.syauto.oa;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
import android.widget.FrameLayout;
import android.content.Intent;

public class IndexActivity extends Activity {
	
	

	@Override
	public void onConfigurationChanged(Configuration newConfig) {
		FrameLayout localFrameLayout = (FrameLayout)this.findViewById(R.id.Index);
		if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE)
			localFrameLayout.setBackgroundResource(R.drawable.bg_landscape);
		else
			localFrameLayout.setBackgroundResource(R.drawable.bg);
		super.onConfigurationChanged(newConfig);
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.index);
		
		Handler localHandler = new Handler();
		localHandler.postDelayed(new splashhandler(), 3000);
	}

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		super.onKeyDown(keyCode, event);
		return false;
	}
	
	class splashhandler implements Runnable {
		public void run() {
			//if(!UserInfo.login())
			startActivity(new Intent(getApplication(),LoginActivity.class));
			//else
			//startActivity(new Intent(getApplication(),MainTabActivity.class));
			
			IndexActivity.this.finish();
		}
	}
}
